package com.lucenly.spell.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import com.lucenly.spell.adapter.AdressListAdapter
import com.lucenly.spell.adapter.OrderAdapter
import com.lucenly.spell.base.BaseActivity
import com.lucenly.spell.databinding.ActivityAdressListBinding
import com.moregold.mvvmlib.ext.ext_doubleClick
import com.moregold.mvvmlib.ext.startActivity

class AdressListActivity : BaseActivity<ActivityAdressListBinding>() {


    override fun getViewBinding(): ActivityAdressListBinding {
       return ActivityAdressListBinding.inflate(layoutInflater,baseBinding.contentMain,true)
    }

    override fun setTitle(): String {
        return "收货地址"
    }

    override fun initData() {
        var list = arrayListOf<String>()
        for (i in 1..6){
            list.add(""+i)
        }
//        binding.content.setBackgroundColor(color)
        binding.recyclerView.layoutManager = LinearLayoutManager(context)
        val itemAdapter = AdressListAdapter(list, context!!)
        binding.recyclerView.adapter = itemAdapter
    }

    override fun initEvent() {
        binding.tvAdd.ext_doubleClick {
            startActivity<AddAdressActivity>()
        }
    }

    override fun startObserve() {
    }

    override fun getStatusType(): Int {
        return 2
    }
}